import './App.css';
import { useAuth } from './contexts/AuthContext';
import LoginPage from '@/components/login-page';
import HomePage from '@/components/home-page';
import { invoke } from '@tauri-apps/api/core';

function App() {
  const { user, logIn } = useAuth();

  if (user !== null) {
    invoke('init_wx').then((result) => console.log('result:', result));
    return <HomePage />;
  } else {
    return <LoginPage onLogIn={logIn} />;
  }
}

export default App;
